<%--
  Created by IntelliJ IDEA.
  User: 67693
  Date: 2021/7/21
  Time: 17:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>我的订单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/library/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/library/css/public.css" media="all">
    <script src="/library/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
            <!--表单，查询出的数据在这里显示-->
            <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

            <script type="text/html" id="currentTableBar">
                <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="buy">购买</a>
            </script>
    </div>
</div>

<script src="/library/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="/library/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>

    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            table = layui.table;
        var form = layui.form,
            layer = layui.layer;

        table.render({
            elem: '#currentTableId',
            url: '/getUserOrderByUsername',     //查询全部数据
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],
            cols: [[
                {field: 'order_id', width: 150, title: '订单号'},
                {field: 'order_goodsname', width: 200, title: '商品名'},
                {field: 'order_username', width: 200, title: '买家'},
                {field: 'order_buyerphone', width: 200, title: '买家联系方式'},
                {field: 'order_address', width: 200, title: '收货地址'},
                {field: 'order_price', width: 200, title: '价格（元）'},
                {field: 'order_time', width: 200, title: '下单时间'},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,  <!--默认显示15条-->
            page: true,
            skin: 'line',
            id:'testReload'
        });

        // var $ = layui.$, active = {
        //     reload: function(){
        //         var order_id = $('#order_id').val();
        //         var order_goodsname = $('#order_goodsname').val();
        //         var order_username = $('#order_username').val();
        //         var order_buyerphone = $('#order_buyerphone').val();
        //         var order_address = $('#order_address').val();
        //         var order_time = $('#order_time').val();
        //         console.log(name)
        //         //执行重载
        //         table.reload('testReload', {
        //             page: {
        //                 curr: 1 //重新从第 1 页开始
        //             }
        //             ,where: {
        //                 order_id: order_id,
        //                 order_goodsname:order_goodsname,
        //                 order_username: order_username,
        //                 order_buyerphone: order_buyerphone,
        //                 order_address:order_address,
        //                 order_time: order_time
        //             }
        //         }, 'data');
        //     }
        // };
        //
        // $('.demoTable .layui-btn').on('click', function(){
        //     var type = $(this).data('type');
        //     active[type] ? active[type].call(this) : '';
        // });
    });
</script>
</body>
</html>
